from Base import message, intersect, SS_VALID
from DRG import MDCR_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["01.5900x053","01.5900x054","06.3100x002","06.3102","06.9900x003","32.2400x001","32.2500x001","39.7100x004","39.7900x017","39.7900x019","39.7900x020","39.7900x021","39.7900x025","39.7903","39.7904","39.7906","41.4200x003","41.4200x005","43.4100x026","44.4400x005","44.4403","50.2301","50.2302","50.2303","50.2400x001","50.2400x002","50.2401","50.2402","50.2403","50.2404","50.2501","50.2502","50.2503","50.2902","52.2200x005","52.2200x006","52.2200x007","52.2200x008","52.2200x009","52.2202","54.4x00x039","54.4x00x048","54.4x00x055","55.3300x001","68.2500x001","99.2500x017","99.2501"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合RM1入组条件，匹配规则：主手术匹配')

    if MDCR_DRG.RM11_group(record):
      return 'RM11'

    if MDCR_DRG.RM15_group(record):
      return 'RM15'
        
    return 'RM1'
  else:
    return ''
    
